package nl.hanze.designpatterns;

import nl.hanze.designpatterns.DAO.impl.file.crypted.LoginCredentialFDAOImpl;
import nl.hanze.designpatterns.DAO.impl.file.ser.TroubleTicketFDAOImpl;
import nl.hanze.designpatterns.Domain.LoginCredential;
import nl.hanze.designpatterns.Domain.TroubleTicket;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Aron on 6-10-2014.
 */
public class GenerateTroubleTicketSerialized {
    public static void main(String [] args) {
        generate();
    }

    public static void generate() {
        ArrayList<TroubleTicket> tickets = new ArrayList<TroubleTicket>();
        TroubleTicket ticket = new TroubleTicket("test", "Mineturte", "Hello", "Yesterday");
        ticket.id = 1;
        tickets.add(ticket);
        ticket = new TroubleTicket("username", "Pete", "Lost my password", "Daily");
        ticket.id = 2;
        tickets.add(ticket);

        TroubleTicketFDAOImpl.Serialize(tickets);
        List<TroubleTicket> ticketsResult = TroubleTicketFDAOImpl.Deserialize();
        System.out.println(ticketsResult.size());
    }
}
